<?php
namespace app\common\enums;


/**
 * 订单状态
 * Class OrderStatusEnum
 * @author luxoianhui
 */
class OrderStatusEnum extends BaseEnum
{
    const NOT_PAY = 0;
    const PAY = 1;
    const SHIPMENTS = 2;
    const SING = 3;
    const ACCOMPLISH = 4;
    const RETUREN_APPLY = -1;
    const RETUREN_ING = -2;
    const RETUREN = -3;
    const REPEAL = -4;
    const REPEAL_APPLY = -5;

    /**
     * @return array
     */
    public static function getMap(): array
    {
        return [
            self::NOT_PAY => '待付款',
            self::PAY => '待发货', // 已付款
            self::SHIPMENTS => '已发货',
            self::SING => '已收货',
            self::ACCOMPLISH => '已完成',
            self::REPEAL => '已关闭',
            // self::RETUREN_APPLY => '退货申请',
            self::RETUREN_ING => '退款中',
            self::RETUREN => '已退货',
        ];
    }

    /**
     * 已下单的状态未被关闭的
     *
     * @return array
     */
    public static function haveBought()
    {
        return array_keys([
            self::NOT_PAY => '待付款',
            self::PAY => '待发货', // 已付款
            self::SHIPMENTS => '已发货',
            self::SING => '已收货',
            self::ACCOMPLISH => '已完成',
            self::RETUREN_APPLY => '退货申请',
            self::RETUREN_ING => '退款中',
            self::RETUREN => '已退货',
            self::REPEAL_APPLY => '撤销申请',
        ]);
    }

    /**
     * 商品柜订单列表展示集合
     * @return array
     */
    public static function cabinetOrderShow(){
        return [
            self::NOT_PAY,
            self::ACCOMPLISH,
            self::RETUREN_ING,
            self::RETUREN,
        ];
    }

    
    /**
     * 商城订单列表展示集合
     * @return array
     */
    public static function productOrderShow(){
        return [
            self::NOT_PAY,
            self::PAY,
            self::SHIPMENTS,
            self::ACCOMPLISH,
            self::RETUREN_ING,
            self::RETUREN,
        ];
    }



}